for i in range(100, 1000):
    temp = i
    num = 0
    for j in range(3):
        num += (temp % 10)**3
        temp //= 10
    if num == i:
        print(num, end = ' ')
print()

input("Press any key to continue")